package edu.hunau.cxb19.oop.class05.ex;

import org.junit.Test;

/**
 *
 * @author hb
 *
 *         2020-02-28 15:00:13
 */
public class ObjEx2Test {

	@Test
	public void call() {
		Child c = new Child();
		System.out.println(c.getData());//from Parent
		//A from paren  B from Child C null
	}
}

class Parent {
	private String data = "from Parent";
 	public String getData() { return data; }
 
	public void setData(String data) { this.data = data; }

}

class Child extends Parent {
	private String data = "from Child";
}

